{% extends "posts/show/layout.html" %}
{% load static %}
{% load posts %}
{% load text_filters %}

{% block title %}
    {{ post.prefix}}: {{ post.author.full_name | rutypography }} — {{ settings.APP_NAME }}
{% endblock %}

{% block og_tags %}
    <meta property="og:title" content="{{ post.prefix}}: {{ post.author.full_name | rutypography }} — {{ settings.APP_NAME }}">
    <meta property="og:site_name" content="{{ settings.APP_NAME }}">
    <meta property="og:url" content="{{ settings.APP_HOST }}">
    <meta property="og:type" content="website" />
    <meta property="og:description" content="">
    <meta property="og:image" content="{{ user.get_avatar }}">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="{{ post.prefix}}: {{ post.author.full_name | rutypography }} — {{ settings.APP_NAME }}">
    <meta name="twitter:description" content="">
    <meta name="twitter:image" content="{{ user.get_avatar }}">

    <!-- Exclude intros from search engines -->
    <meta name="robots" content="noindex">
{% endblock %}

{% block post %}
<section class="content">
    <article class="post post-type-post">
        <header class="post-header">
            <h1 class="post-title">
                {{ post.prefix}}: {{ post.author.full_name | rutypography }}
            </h1>
            <div class="post-data">
                <div class="post-actions-line">
                    {% include "posts/widgets/post_actions_line.html" %}
                </div>

                {% if post.metadata.badges %}
                    <a class="post-badges post-badges-center" href="{% url "profile_badges" post.author.slug %}">
                        {% include "badges/widgets/badges.html" with badges=post.metadata.badges %}
                    </a>
                {% endif %}
            </div>
        </header>
        <section class="post-text">
            <post-upvote :initial-upvotes="{{ post.upvotes }}"
                         :hours-to-retract-vote="{{settings.RETRACT_VOTE_IN_HOURS}}"
                         upvote-url="{% url "upvote_post" post.slug %}"
                         retract-vote-url="{% url "retract_post_vote" post.slug %}"
                         {% if is_voted %}
                            initial-is-voted
                            initial-upvote-timestamp={{upvoted_at}}
                         {% endif %}
                         {% if not me|can_upvote_post:post or upvote_disabled %}is-disabled{% endif %}>
            </post-upvote>
            <div class="text-body text-body-type-post e-content">
                {% render_post post %}
            </div>
        </section>
        <section class="post-footer p-author">
            {% include "users/widgets/card.html" with user=post.author %}
        </section>
    </article>
</section>
{% endblock %}
